package test;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;


public class Exam1 {
	


	public void Exam() throws IOException{
		FileOutputStream out= new FileOutputStream("test.txt");
		PrintWriter pw = new PrintWriter(out);
		File file = new File("input");
		File[] fText = file.listFiles();
		
		for(int i=0;i<fText.length;i++){
			
			System.out.println(fText[i]);
			
			FileInputStream fi = new FileInputStream(fText[1]);
			InputStreamReader ir = new InputStreamReader(fi);
			BufferedReader br = new BufferedReader(ir);
			
			String fread =null;
			while((fread=br.readLine())!=null){
				System.out.println(fread);
				//pw.println(fread);
			}
		}
			
		pw.close();
		
	}

	public static void main(String[] args) throws Exception {
		Exam1 aa = new Exam1();
		aa.Exam();
		
	}

}
